UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Zu7VrkjRS4kzDvT0CMRXpmCO/57PnnhuCsvP9ftBgO8=' 
WHERE 
  key_id = '50190a59325c5456ab1d3a32f852d7640a0b0006e38a87d1a3d6a2558d309877' 
  AND (
    token = 'Zu7VrkjRS4kzDvT0CMRXpmCO/57PnnhuCsvP9ftBgO8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021