UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ElR4WyhXpIFSxCg+/w28aIrXqlsI9yJoadJZsrZ8Kpk=' 
WHERE 
  key_id = '3741edfecf937e91ae7eaccd7a7d95488e013d55ca84a1f60dc1e68df8cab549' 
  AND (
    token = 'ElR4WyhXpIFSxCg+/w28aIrXqlsI9yJoadJZsrZ8Kpk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017