UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qU00jZ4WjL24tZWgoH/9DbQjUzg0YOgq0d54tU06W1U=' 
WHERE 
  key_id = '6fd71d104f247e2662802ac4b34a255bd5bafc4227b390f4ec049a3373049bde' 
  AND (
    token = 'qU00jZ4WjL24tZWgoH/9DbQjUzg0YOgq0d54tU06W1U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034