UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LhpgI91FEGn4yFcnR5Mm+vuyqs7YOSPSo2RZULOnYlw=' 
WHERE 
  key_id = '1ea4343126fea96f35a2e9afdca6c55245573930267f8c4fec7c238bc0e3fc58' 
  AND (
    token = 'LhpgI91FEGn4yFcnR5Mm+vuyqs7YOSPSo2RZULOnYlw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036