UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'suOVsmazqOASQ5lcVMkxg0Duvyn+4dWL4fgQI/PhJAY=' 
WHERE 
  key_id = '92067ac67911b710b39c421423bcbab489859a552db2a3b36d598b796d64bd16' 
  AND (
    token = 'suOVsmazqOASQ5lcVMkxg0Duvyn+4dWL4fgQI/PhJAY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050