UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BL+/wVTKpdcbrVFW9n5tweFskOn8Ue/lcwCrkGUzZxQ=' 
WHERE 
  key_id = '399da8ae3a38bdec6151c4aa5da9c06777cfd8c21eab707fa483688744610fa8' 
  AND (
    token = 'BL+/wVTKpdcbrVFW9n5tweFskOn8Ue/lcwCrkGUzZxQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016