UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/Du/ggrDRHJEBoBO4v641w2UxQcx7baa7oNoUsgyMAk=' 
WHERE 
  key_id = 'ae1b820234820217300640fb5bed3041fc4ee77ae7108c2720c060e8a560bb9c' 
  AND (
    token = '/Du/ggrDRHJEBoBO4v641w2UxQcx7baa7oNoUsgyMAk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026