UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ffH2MsKpg19jA03yOLr9sDAnlFd71xg8+iywVGMDMIE='
WHERE
key_id = '1eb0ccae5ab3ab1e9dfb18964f4b7f2f84443d9cb12bad0c29b8143cbc32bae7'
AND (
token = 'ffH2MsKpg19jA03yOLr9sDAnlFd71xg8+iywVGMDMIE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)