UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vpGG+6KYbz2OAhcoYaffJNS6o9zFQYbjWrM/hotvQ6Y=' 
WHERE 
  key_id = 'aa43eef018ea113670ea1a7728f8d26ef07c79272d72ca07084b9bd28f100f77' 
  AND (
    token = 'vpGG+6KYbz2OAhcoYaffJNS6o9zFQYbjWrM/hotvQ6Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044