UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+NJu3/38Q1B0yBR5RTFZPpzUigcnOlte6wDQcbg5hP4=' 
WHERE 
  key_id = 'ddb3a82729a9474001afbc0d854996c2f44a7f63915e6353fc53b4fe7f9c0791' 
  AND (
    token = '+NJu3/38Q1B0yBR5RTFZPpzUigcnOlte6wDQcbg5hP4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035