UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'D3ASTqHMCLscmXVMubSMK7avUnyT6IUUtaKL5DPzvT0=' 
WHERE 
  key_id = '7a30848a34a0ffb6b669f2f02953d551dd4ef2363b88796ca8074de8dff9cb05' 
  AND (
    token = 'D3ASTqHMCLscmXVMubSMK7avUnyT6IUUtaKL5DPzvT0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027