UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IBzJgPPqK2IZa2DPcQ7KxxjwGL88766cZ3PQ82se/rQ=' 
WHERE 
  key_id = '84c5861bcb2b9dc6fd27b1c084e5c0a7f0e806b66385dd54350580f56c84161d' 
  AND (
    token = 'IBzJgPPqK2IZa2DPcQ7KxxjwGL88766cZ3PQ82se/rQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039