UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Grrb7nuuWQ376i0QGPYzxEO4Kc/WH5S2yOdHaAFMiyo=' 
WHERE 
  key_id = '4ea8d4785f63317fa733acc4cde4e492d0744a795480e322104a333c731bcb1c' 
  AND (
    token = 'Grrb7nuuWQ376i0QGPYzxEO4Kc/WH5S2yOdHaAFMiyo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037