UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'c324qxXAnUaZdkQfD7JLSHcoF7i+AldIv4SEwJ4V4EA=' 
WHERE 
  key_id = '18f6645017af141f3d25c945b27e8bfdcc48208f2c19bb8705dad0b8c4658159' 
  AND (
    token = 'c324qxXAnUaZdkQfD7JLSHcoF7i+AldIv4SEwJ4V4EA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041