UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'a68+MJddJ36DhPVRjr7ufEdY4zlgChTmHMKE7qUO8zQ='
WHERE
key_id = 'aac57e7fed9e9463a82e547bbe01ab6670709406fd2c34978b4889d3f5159f82'
AND (
token = 'a68+MJddJ36DhPVRjr7ufEdY4zlgChTmHMKE7qUO8zQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)