UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dI2/TDs4urLVppm6woJ2TsDMx0CVzSIVMYMZAqb/VO8=' 
WHERE 
  key_id = 'f5526b3be411a2adf7199dbd16a5a4941c5ff6b63a69d06814f7a798d704ee2b' 
  AND (
    token = 'dI2/TDs4urLVppm6woJ2TsDMx0CVzSIVMYMZAqb/VO8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031