UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+f//MoPHPuzYI4DcrNrQRK8Wx20zLwwTii1yP555jas=' 
WHERE 
  key_id = '2a09f3a2040b8175a2da1e0993c41a1e42888047a9254f80a029768a172183c0' 
  AND (
    token = '+f//MoPHPuzYI4DcrNrQRK8Wx20zLwwTii1yP555jas=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044