UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VsPfHeEeUQIcLZ5AusURw8Fkmw/JsSUPCUxNI7trGr4='
WHERE
key_id = '391a8572566fb51cd2b209fc4819dbb6a593cd6348b422db637d3ccb96fb07c7'
AND (
token = 'VsPfHeEeUQIcLZ5AusURw8Fkmw/JsSUPCUxNI7trGr4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)