UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'b9t0PeEadZWGN9a6B209oA/NH4VV5tFVGWRKoQ/TCQw='
WHERE
key_id = '76a650136067ef7c1785e5f00cafa8eb1fe60f3b13fcf26f2a5142d7a646b4d1'
AND (
token = 'b9t0PeEadZWGN9a6B209oA/NH4VV5tFVGWRKoQ/TCQw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)