UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fdUdZYQP0H8J0Wqqc8Nd1FmdPqpmxnlFlJQkHZfkzCI=' 
WHERE 
  key_id = '934b28fa70ed33bef8793b36af557a14d6531bec610ceac31f828213ad661dae' 
  AND (
    token = 'fdUdZYQP0H8J0Wqqc8Nd1FmdPqpmxnlFlJQkHZfkzCI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030