UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'o42rQaQSjpLy3x1p24Rsfda8JHUCNMnq6FDB4vbAtG0=' 
WHERE 
  key_id = 'abf8cd0ef48134b94a5067eab89427888e142d1f47b3151423dafdcba068a41a' 
  AND (
    token = 'o42rQaQSjpLy3x1p24Rsfda8JHUCNMnq6FDB4vbAtG0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037