UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zjNyIjmrAN4E5WZB835Yaa1XlhORNioGdZlfoZ/3YyU='
WHERE
key_id = '51a7b46e7ce9d4b7f223b77f9b3c9d17372e2e2a84953bd200a7d39b5b6e004e'
AND (
token = 'zjNyIjmrAN4E5WZB835Yaa1XlhORNioGdZlfoZ/3YyU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)