UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gY9KditLLGK1gdSHkvOw2v2rfgoHCK3+Mv7uWcWC5/I=' 
WHERE 
  key_id = '434c97fba6ed4140c878d399c82469bcc60fcf044ac88ba06bdaf6e7411a183e' 
  AND (
    token = 'gY9KditLLGK1gdSHkvOw2v2rfgoHCK3+Mv7uWcWC5/I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039