UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'REL1vMFBR4xnYaYa69ZvuuoWYEBl1LmHHt/BlRY7OxA='
WHERE
key_id = '5d0592cf15dbd2b9e395e677595924f40fe2ae1ca6eece617860780ae0c655d2'
AND (
token = 'REL1vMFBR4xnYaYa69ZvuuoWYEBl1LmHHt/BlRY7OxA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)