UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rV9YK9wMqtiRQ2O2LYwKt0YCswEe6DxhVwp1rdCedao=' 
WHERE 
  key_id = '88f70134094300aeb03fa6ac9673c1cd350182aaf39c280d5d3a046309feebab' 
  AND (
    token = 'rV9YK9wMqtiRQ2O2LYwKt0YCswEe6DxhVwp1rdCedao=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028