UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WpphxxLk0MdAExLWm42o0MP4bY1G0G02lgFLqxfL7Eo='
WHERE
key_id = '2a2d3d5723023dee42034935ed2e6588f8ccb1686356576cece3246f970a27bf'
AND (
token = 'WpphxxLk0MdAExLWm42o0MP4bY1G0G02lgFLqxfL7Eo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)