UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kO5BrhqqcrBfbsNwfQZ1/G2b3r0lKDnX1Z2Dl2diePg=' 
WHERE 
  key_id = '61e00f0f11433d9392217a82ef8686f6a773d80e5bfc4733704c8510c0eae343' 
  AND (
    token = 'kO5BrhqqcrBfbsNwfQZ1/G2b3r0lKDnX1Z2Dl2diePg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031