UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+xkqLI7zQwvWAXuxJKKVOpvLF88kK8EQzjK07kwrvxI='
WHERE
key_id = 'bb702ea0f5cc975f0aaf8956e00d4d78fae9677345215c35972b4d256f58dd85'
AND (
token = '+xkqLI7zQwvWAXuxJKKVOpvLF88kK8EQzjK07kwrvxI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)