UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4E4W/FBOCMrTIj1mQchCwVdS2Pp5RL1dVGOgDvTf2Tg='
WHERE
key_id = 'becfd5fd442e54640f91e05281a89077b2efadbbcf17e9d1b5c142519e72b2aa'
AND (
token = '4E4W/FBOCMrTIj1mQchCwVdS2Pp5RL1dVGOgDvTf2Tg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)