UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8ZXFg1MLXDOmO4vCrbnd0lQwH/ZqthVyKZYnAFp//F0='
WHERE
key_id = '3a7738e8ca5eca7ac1362ec4b04cb40c6cc86d01128106264f83c95395a58764'
AND (
token = '8ZXFg1MLXDOmO4vCrbnd0lQwH/ZqthVyKZYnAFp//F0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)