UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lIf9QULkie0IT5aN/K4UadFK5NSW3DKU0VdhzJXPr4U=' 
WHERE 
  key_id = 'f4033a704fd34f767783c24f18062f6c7618db1a546a0cf1b1efe8829422bcf7' 
  AND (
    token = 'lIf9QULkie0IT5aN/K4UadFK5NSW3DKU0VdhzJXPr4U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032