UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'z4TqI3bjamgDunYju7FTIMg/Bun3dyNtGVXMD62+vbo='
WHERE
key_id = 'b81db1da1f687dc0071137b3f2d27dc79e9c75e7462f50e0dcf77e5806d17b0e'
AND (
token = 'z4TqI3bjamgDunYju7FTIMg/Bun3dyNtGVXMD62+vbo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)