UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'V1lK2LayJOekFzA2f75ynYAQWMplCAW7EheP4V6ZRgc=' 
WHERE 
  key_id = '257789bb8c33b49b7f13beabc7d82809603e774c06cfe279c8d069ed872d2660' 
  AND (
    token = 'V1lK2LayJOekFzA2f75ynYAQWMplCAW7EheP4V6ZRgc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028