UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'omme77QkjmgAIHnSoyov2eXdK2VAGFb0cNktDR7OmW0='
WHERE
key_id = '64da7ec8285a7769cb0351c344b6c1ba00ae2b85d6b55280ddc04baaa4e91beb'
AND (
token = 'omme77QkjmgAIHnSoyov2eXdK2VAGFb0cNktDR7OmW0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)