UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3DTEsq5HAWuPik7DwAWSziYa/Z+UhQmOrGJFYjogO9Q=' 
WHERE 
  key_id = 'c11dd26a808e08001dbcce4a0789437cf9a3a631b1be3654426c7e30fdc37157' 
  AND (
    token = '3DTEsq5HAWuPik7DwAWSziYa/Z+UhQmOrGJFYjogO9Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00061