UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vzXN9OiW3BLeb3fwz8v2hPMkNOauMmkbaaQSPvjsJjo=' 
WHERE 
  key_id = '5e3a7195c649648bad1081e0ba9d4e874becca254caa24770ed03b14ba019e1b' 
  AND (
    token = 'vzXN9OiW3BLeb3fwz8v2hPMkNOauMmkbaaQSPvjsJjo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032