UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'S1KTk3YkGRm6mR/r6cW1zGxe7O+ciB/Mo2lphw2dpmI=' 
WHERE 
  key_id = '057b076e84d256e37e3821d2653383c10a4cd8f21ea4a880fd5942249e7e7dc2' 
  AND (
    token = 'S1KTk3YkGRm6mR/r6cW1zGxe7O+ciB/Mo2lphw2dpmI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017