UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SWai3EoRIePhkkYgW+x3N7B74HMMloJ/NMTH3U5IN4M='
WHERE
key_id = 'ce6be642b3873f08cc578b1fbf416847dbe84ec020879e4c4408d102da6f03ce'
AND (
token = 'SWai3EoRIePhkkYgW+x3N7B74HMMloJ/NMTH3U5IN4M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)