UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YnjZJTFf/NfpJYYb+UOvgEk3CSlCOA6e5X/GFhOgv9Y=' 
WHERE 
  key_id = '448fa721b1607d7ec39cb705ab09db46f29de63dd0646088c43895fbca27b509' 
  AND (
    token = 'YnjZJTFf/NfpJYYb+UOvgEk3CSlCOA6e5X/GFhOgv9Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022