UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GKdQV2WRVt7/PBaxiBlxKmFZb46M3elJ+9EUv612KGk='
WHERE
key_id = 'b2571731c97b2d0a0ab6bf7b07434dbbdc851a3f4ef3578cb2de36c286d2bc85'
AND (
token = 'GKdQV2WRVt7/PBaxiBlxKmFZb46M3elJ+9EUv612KGk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)