UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2XUXs799nY9wCBW2ato0tcuCF8AndRAho8zJ3uOrJnI='
WHERE
key_id = 'd37eed827c933c5385c16025588a7e26ced1ae0949c83e9461327861b9b95a3b'
AND (
token = '2XUXs799nY9wCBW2ato0tcuCF8AndRAho8zJ3uOrJnI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)