UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'd4Z13XlsKnnBwXbNZkMqpvYW91To9VUUfuzTN+KSftQ='
WHERE
key_id = '562923e185ae51136752a249af8eb37dc9653d284705f8503002a96523e6781a'
AND (
token = 'd4Z13XlsKnnBwXbNZkMqpvYW91To9VUUfuzTN+KSftQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)